package com.deyuanyun.pic.integalz.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.deyuanyun.pic.business.controller.dto.PipeLineNewTaskVO;
import com.deyuanyun.pic.integalz.controller.dto.IntegalzInspTaskQueryVO;
import com.deyuanyun.pic.integalz.enumeration.InspTableNameEnum;
import com.deyuanyun.pic.pipe.domain.PipeSegmentInfo;


/**
 * 内检测任务在一根管道上的各种计算服务
 * 
 * @author ChenKui
 *
 */
public interface PipeLineInspTaskService {

    /**
     * 根据绝对里程合并管道的内检测任务（最新的任务）
     * @param pipeLineId
     * @return
     */
    List<PipeLineNewTaskVO> queryNewInspTaskMerge(String pipeLineId);
    

    /**
     * 根据绝对里程合并管道的内检测任务（次新的任务）
     * 
     * @param pipeLineId
     * @param pipeLineNewTaskList 查询出来给定条件的上一次任务，若无上一次任务，则对应位置为null
     * @return
     */
    List<PipeLineNewTaskVO> qeurySecondInspTaskMerge(String pipeLineId,List<PipeLineNewTaskVO> pipeLineNewTaskList);
    
    
    /**
     * 获取内部金属损失
     * 
     * @param integalzQuery
     * @param pipeLineInspTaskList
     * @return CLOCK,MILEAGE
     */
    List<Map<String,Object>> queryInspMetaLoss(IntegalzInspTaskQueryVO integalzQuery,List<PipeLineNewTaskVO> pipeLineInspTaskList);
    

    /**
     * 获取外部金属损失
     * 
     * @param integalzQuery
     * @param pipeLineInspTaskList
     * @return CLOCK,MILEAGE
     */
    List<Map<String,Object>> queryExinspMetaLoss(IntegalzInspTaskQueryVO integalzQuery,List<PipeLineNewTaskVO> pipeLineInspTaskList);
    
    /**
     * 获取环焊缝异常
     * 
     * @param integalzQuery
     * @param pipeLineInspTaskList
     * @return FEATURE_NUMBER,MILEAGE
     */
    List<Map<String,Object>> queryGirthWeld(IntegalzInspTaskQueryVO integalzQuery,List<PipeLineNewTaskVO> pipeLineInspTaskList);
    

    /**
     * 获取环焊缝返修
     * 
     * @param integalzQuery
     * @return GWW_NUMBER,MILEAGE
     */
    List<Map<String,Object>> queryGwwRepairind(IntegalzInspTaskQueryVO integalzQuery);
    
    /**
     * 查询内检测缺陷
     * 
     * @param inspTableNameEnum
     * @param inspTaskId
     * @return CLOCK,MILEAGE
     */
    List<Map<String,Object>> queryInspDefect(InspTableNameEnum inspTableNameEnum,String inspTaskId,BigDecimal startMileage,BigDecimal endMileage);
    
    /**
     * 查询内检测任务
     * 
     * @param pipeLineId
     * @param pipeLineNewTask
     * @return PAG_DATETIME,STARTMILEAGE,ENDMILEAGE,NAME,ID,FROM_PIPE_VALVEROOM_ID,TO_PIPE_VALVEROOM_ID,FROM_PIPE_VALVEROOM_NAME,TO_PIPE_VALVEROOM_NAME,SEWAGE,DIRT
     */
    List<Map<String,Object>> findInspTask(String pipeLineId, PipeLineNewTaskVO pipeLineNewTask, Boolean detectorTypeIsnull);
    
    
    /**
     * 查询管段信息
     * 
     * @param pipeLineId
     * @param start
     * @param end
     * @return
     */
    PipeSegmentInfo querySegmentInfo(String pipeLineId,BigDecimal mileage);
    
}
